package com.warmlight.voicepacket.http;

/**
 * Created by jason on 2018/5/29.
 */

import com.warmlight.voicepacket.utils.SPUtils;
import com.warmlight.voicepacket.utils.TimeFormatUtils;

/**
 * 接口地址配置类及接口api
 */
public class HttpConfig {

    public static boolean isTest = false;
//    private static final String TEST_URL = "http://192.168.1.101:9281";
    private static final String TEST_URL = "http://api.test.wanpi.nuanguang.vip:8888/v1";
//    private static final String TEST_URL = "http://192.168.1.102:8888";
    private static final String ONLINE_URL = "http://api.wanpi.nuanguang.vip/v1";
    public static final String SERVER =isTest ? TEST_URL : ONLINE_URL;
//    public static String SERVER = ONLINE_URL;
    //im通讯
    public static final String IMAppkey = isTest ? "x4vkb1qpxfo2k" : "pvxdm17jp3qir";
    public static final String IMappSecret = isTest ? "Cl5T4FulHZ172U" : "t2RIqCY2kkL";


    //发现页顶部接口，包含第一屏feed
    public static final String DISCOVER = "/discover";

    //发现页下一屏数据
    public static final String DISCOVER_FEED = "/discover/feed";

    //播单页，全部
    public static final String COVER = "/cover";

    //播单页，单个topic
    public static final String COVER_DETAIL = "/cover/detail";

    //点赞
    public static final String SET_STAR = "/audio/set_star";

    //版本号
    public static final String VERSION = "/version/index";

    //分享结果上传
    public static final String SHARE = "/audio/share";

    //收藏结果回调
    public static final String collect = "/audio/set_collect";

    //搜索初始化
    public static final String SEARCH_INIT =SERVER + "/search";

    //清空搜索记录
    public static final String SEARCH_CLEAR =SERVER + "/search/clear";

    //搜索结果`
    public static final String SEARCH_RUSULT =SERVER + "/search/result";
    //服务端打点
    public static final String CLICK_LOG= SERVER + "/audio/click_log";
    //发送验证码
    public static final String MSG_CODE = SERVER + "/member/msg_code";
    //手机号登录
    public static final String LOGIN = SERVER + "/member/login";
    //第三方登录
    public static final String LOGIN_AUTH = SERVER +"/member/login_auth";
    //手机注册
    public static final String REGISTER = SERVER + "/member/register";
    //编辑资料
    public static final String EDIT_PROFILE = SERVER + "/member/edit_profile";
    //同步数据
    public static final String SYNC_DATA = SERVER + "/audio/sync_data";
    //个人中心
    public static final String USER_CENTER = SERVER + "/member/user_center";
    //获取用户播单详情
    public static final String USER_COVER_DETAIL = SERVER + "/member/user_cover_detail";
    //新建播单
    public static final String CREATE_COVER = SERVER + "/member/create_cover";
    //忘记密码
    public static final String FORGET_PASSWORD = SERVER + "/member/reset_pass";
    //退出登录
    public static final String LOGOUT = SERVER + "/member/login_out";
    //删除我的网络播单或音频
    public static final String USER_DEL_AUDIO = SERVER + "/member/user_del_audio";
    //帖子详情
    public static final String POSTDEL = SERVER + "/post/post_data";
    //评论的评论
    public static final String REPLY_REPLY = SERVER + "/post/reply_reply";
    //好听就撩
    public static final String GOODLISTENERTEASE = SERVER + "/memberAudio/index";
    //好听就撩我的列表
    public static final String GOODLISTENERTEASEMINE = SERVER + "/memberAudio/user_feed";
    //好听就撩点赞
    public static final String MEMBERAUDIOSTAR = SERVER + "/memberAudio/star";
    //用户上传音频设置为公开
    public static final String AUDIO_SET_OPEN = SERVER + "/audio/set_open";
    //用户消息列表（非对话）
    public static final String NEWS_LIST = SERVER + "/member/news_list";
    //获取用户信息
    public static final String GET_INFO = SERVER + "/member/get_info";
    //绑定极光
    public static final String PUSH = SERVER + "/memberAudio/push";
    //点赞接口
    public static final String MEMBERLIKE = SERVER + "/memberLike/up_like";
    //获取举报列表
    public static final String GET_REPORT = SERVER + "/member/get_report";
    //举报帖子或者评论
    public static final String REPORT = SERVER + "/member/report";
    //发表评论
    public static final String ADD_REPLY = SERVER + "/post/add_reply";
    //获取个人动态列表
    public static final String USER_POST = SERVER + "/member/user_post";
    //获取个人音频列表
    public static final String USER_AUDIO = SERVER + "/member/user_audio";
    //删除个人动态
    public static final String DEL_USER_POST = SERVER + "/post/del_post";
    //个人主页 客态
    public static final String USER_COVER = SERVER + "/member/user_cover";
    //删除个人音频
    public static final String DEL_AUDIO = SERVER + "/audio/del_audio";
    //首页视频
    public static final String APP_VIDEO = SERVER + "/app/load";
    //IM相关

    //获取token
    public static final String GETTOKEN = "http://api.cn.ronghub.com/user/getToken.json";

    //用户使用手册
    public static final String USERCONDINTION = "http://m.nuanguang.vip/wanpi/UserCondition.html";
    //隐私策略
    public static final String USERPRIVACY = "http://m.nuanguang.vip/wanpi/UserPrivacy.html";


    //阿里阿里云阿里云阿里云阿里云阿里云阿里云阿里云阿里云阿里云阿里云阿里云阿里云阿里云
    // To run the sample correctly, the following variables must have valid values.
    // The endpoint value below is just the example. Please use proper value according to your region
    public static final String accessKeyId     = "LTAIqUbOPUz16zaX";
    public static final String accessKeySecret = "FzQDTPRfbKRrJ3U9d6psiIa36iJ3lF";

    // 访问的endpoint地址 http://wanpi-img.oss-cn-shanghai.aliyuncs.com
    public static final String endpoint = "oss-cn-shanghai.aliyuncs.com";
    //callback 测试地址
    public static final String callbackAddress = "http://oss-demo.aliyuncs.com:23450";
    // STS 鉴权服务器地址，使用前请参照文档 https://help.aliyun.com/document_detail/31920.html 介绍配置STS 鉴权服务器地址。
    // 或者根据工程sts_local_server目录中本地鉴权服务脚本代码启动本地STS 鉴权服务器。详情参见sts_local_server 中的脚本内容。
    public static final String STSSERVER = "http://*.*.*.*:****/sts/getsts";//STS 地址

    public static final String uploadFilePath = ""; //本地文件上传地址
    public static final String bucket = "wanpi-img";
    public static final String ali = "http://wanpi-img.oss-cn-shanghai.aliyuncs.com/";
//    public static final String objectName = "wanpi/"+ SPUtils.getLoginUid()+"/"+ "avator" +"/";
//    public static final String localAudio = "wanpi/"+ SPUtils.getLoginUid()+"/"+ "local" +"/";
//    public static final String replyImg = "wanpi/"+ SPUtils.getLoginUid()+"/"+ "replyimg" +"/";
    //这种写法造成数据无法及时更新
//    public static final String objectName = "wanpi/"+ SPUtils.getLoginUid()+"/"+ "avator" +"/";
//    public static final String localAudio = "wanpi/"+ SPUtils.getLoginUid()+"/"+ "local" +"/";
    public static final String uploadObject = "上传object名称";
    public static final String downloadObject = "下载object名称";

    public static String objectName(){
        return  "wanpi/"+ SPUtils.getLoginUid()+"/"+ "avator" +"/";
    }

    public static String localAudio(){
        return "wanpi/"+ SPUtils.getLoginUid()+"/"+ "local" +"/";
    }

    public static String replyImg(){
        return "wanpi/"+ SPUtils.getLoginUid()+"/"+ "replyimg" +"/"+HttpClient.getUniquePsuedoID()+"_"+TimeFormatUtils.getCurrentTimeMillis()+"_";
    }

    public static final int DOWNLOAD_SUC = 1;
    public static final int DOWNLOAD_Fail = 2;
    public static final int UPLOAD_SUC = 3;
    public static final int UPLOAD_Fail = 4;
    public static final int UPLOAD_PROGRESS = 5;
    public static final int LIST_SUC = 6;
    public static final int HEAD_SUC = 7;
    public static final int RESUMABLE_SUC = 8;
    public static final int SIGN_SUC = 9;
    public static final int BUCKET_SUC = 10;
    public static final int GET_STS_SUC = 11;
    public static final int MULTIPART_SUC = 12;
    public static final int STS_TOKEN_SUC = 13;
    public static final int FAIL = 9999;
    public static final int REQUESTCODE_AUTH = 10111;
    public static final int REQUESTCODE_LOCALPHOTOS = 10112;


    public static final int MESSAGE_UPLOAD_2_OSS = 10002;
}
